Skip to content

Added machine-readable IP:PORT in text-mode daemon #2101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Mar 9, 2023

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

When running the daemon in text mode a line with a parable JSON is printed together with the text. This will allow the Arduino IDE to pick this up when running in text-mode with -v logging and --debug enabled.

What is the current behavior?

$ arduino-cli daemon -v --debug
INFO[0000] Using config file: /home/megabug/.arduino15/arduino-cli.yaml 
INFO[0000] arduino-cli version 0.0.0-git                
INFO[0000] Executing `arduino-cli daemon`               
Deamon è ora in ascolto su 127.0.0.1:50051

What is the new behavior?

A line with a machine-readable JSON is added to the output:

$ arduino-cli daemon -v --debug
INFO[0000] Using config file: /home/megabug/.arduino15/arduino-cli.yaml 
INFO[0000] arduino-cli version 0.0.0-git                
INFO[0000] Executing `arduino-cli daemon`               
Deamon è ora in ascolto su 127.0.0.1:50051
{"IP":"127.0.0.1","Port":"50051"}

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

@cmaglie cmaglie requested review from Bikappa, umbynos and kittaakos March 9, 2023 10:44
@cmaglie cmaglie self-assigned this Mar 9, 2023
@cmaglie cmaglie added type: enhancement Proposed improvement topic: CLI Related to the command line interface labels Mar 9, 2023
@codecov
Copy link

codecov bot commented Mar 9, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (736d161) 36.45% compared to head (6a23182) 36.45%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2101      +/-   ##
==========================================
- Coverage   36.45%   36.45%   -0.01%     
==========================================
  Files         229      229              
  Lines       19587    19588       +1     
==========================================
  Hits         7140     7140              
- Misses      11610    11611       +1     
  Partials      837      837              
Flag Coverage Δ
unit 36.45% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
internal/cli/daemon/daemon.go 0.00% <0.00%> (ø)
commands/lib/search.go 88.15% <0.00%> (-3.95%) ⬇️
arduino/cores/packagemanager/package_manager.go 71.07% <0.00%> (+0.61%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@cmaglie cmaglie merged commit 6992de7 into arduino:master Mar 10, 2023
@cmaglie cmaglie deleted the debug_output_enhance branch March 10, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: CLI Related to the command line interface type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants